﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;
using Microsoft.Web.Administration;

namespace SimpleApp.Controllers
{
    public class IISController : Controller
    {
        public ActionResult Index()
        {
            List<string> appList = new List<string>();
            ServerManager serverManager = new ServerManager();
            foreach( var site in serverManager.Sites)
            {
                foreach(var app in site.Applications)
                {
                   appList.Add(app.Path.ToString().Substring(1));
                }
            }
            return View(appList);
        }
       
    }
}
